import { Controller, Get, Query } from '@nestjs/common';
import { Imgd_Service } from '../imgd/imgd.service';
import { ApiTags } from '@nestjs/swagger';
import { Imgd_FindAll_Dto, Imgd_Enum_TypeKeys_Dto } from '../imgd/assets/imgd.dto';
import { util_ApiResponse_Base } from '@/common/util/apiResponse';
import { util_Index_ReturnContent } from '@/common/util/index';

@Controller('/web/imgdWeb')
@ApiTags('imgdWeb 图片')
export class ImgdWeb_Controller {
  constructor(private readonly imgd_Service: Imgd_Service) {}

  @Get('/typeKey')
  @util_ApiResponse_Base({
    dataType: 'dataType_list',
    //apiKey: '/web/imgdWeb/typeKey Get',
    noAuth: true,
  })
  async imgdWeb_FindAllByTypeKey(@Query() query: Imgd_FindAll_Dto) {
    return util_Index_ReturnContent(await this.imgd_Service.imgd_FindAll(query));
  }

  @Get('/typeKeys')
  @util_ApiResponse_Base({
    dataType: 'dataType_list',
    //apiKey: '/web/imgdWeb/typeKeys Get',
    summary: '批量keys获取图片',
    noAuth: true,
  })
  async imgdWeb_FindByTypeKeys(@Query() query: Imgd_Enum_TypeKeys_Dto) {
    return util_Index_ReturnContent(await this.imgd_Service.imgd_FindByTypeKeys(query));
  }
}
